package com.weixin.demo.kotlinboot.dao

import com.weixin.demo.kotlinboot.bean.Video
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.CrudRepository
import org.springframework.data.repository.query.Param

/**
 *
 * @author zhenggm
 * @version 1.0.0
 */


interface VideoRepository : CrudRepository<Video, Long> {

    @Query("from Video u where u.author=:name")
    fun findUser(@Param("name") name: String): List<Video>

    fun findById(id: Long):Video
}